package com.coolgor.axnut.enums.wechat.qyh;

public enum QYHUserStateEnum {
	SUCCESS(1, "操作成功"), 
	INNER_ERROR(-1001, "操作失败"), 
	NULL_USERID(-1002, "userId为空"),
	NULL_CORPID(-1003, "userId为空"),
	NULL_USER(-1004, "user信息为空"),
	EMPTY_LIST(-1005, "数据列表为空"), 
	EXISTUSERINFO(-1006, "用户信息已存在"),
	NULL(-1010, "获取数据为空");

	private int state;

	private String stateInfo;

	private QYHUserStateEnum(int state, String stateInfo) {
		this.state = state;
		this.stateInfo = stateInfo;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public static QYHUserStateEnum stateOf(int index) {
		for (QYHUserStateEnum state : values()) {
			if (state.getState() == index) {
				return state;
			}
		}
		return null;
	}
}
